package com.st.app.test.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.st.app.test.entities.UserEntity;
import com.st.app.test.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author future
 * @Desc： 用户服务
 * *
 * @date 11/25/24
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public List<UserEntity> getAllUser() {
        return userMapper.selectList(null);
    }
    public UserEntity getUserById(Long id) {

        QueryWrapper<UserEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id", 111L);
        List<UserEntity> userEntities = userMapper.selectList(queryWrapper);
        System.out.println(userEntities+"=====================");
        return userEntities.get(0);
    }
}
